<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/common.jsp"%>
<%@ page import="com.chanyachting.emall.util.RequestUtil"%>
<%@ page import="com.chanyachting.emall.util.CodeMap"%>
<%@ page import="com.chanyachting.emall.domain.Applicationleter"%>
<%@ page import="com.chanyachting.emall.domain.Educationhistory"%>
<%@ page import="com.chanyachting.emall.service.ApplicationLeterService"%>
<%@ page import="com.chanyachting.emall.serviceImpl.ApplicationLeterServiceImpl"%>

<%@ page import="java.util.*"%>

<%

	RequestUtil ru=new RequestUtil(request);
	
	//获得求职信息id
	Integer appId=Integer.parseInt(ru.getParameter("id","0"));

%>


<script type="text/javascript">
<!--

	//显示教育经历输入表单
	function showAddEH(){

		//document.getElementById('b1').style.display='';

		window.open("applicationLeter_educationhistory_add.jsp?id=<%=appId%>");

	}


	//删除教育经历
	function deleteEH(id){

		$.post("<%=root %>/memberBackend/educationhistoryDel.do",
				{id:id,appId:"<%=appId%>"},
				function(data){
				$("#educationhistoryList").load("applicationLeter_educationhistory_list.jsp",{id:"<%=appId%>"});
			});
	
	}


	//修改教育经历
	function updateEH(id){


	}

//-->
</script>


<!-- 教育背景-->
<table width="700" border="0" align="center" cellpadding="0"  cellspacing="0" >
	<tr>
		<td height="28" colspan="2" class="td_bottom">
			<strong>教育背景</strong>&nbsp;&nbsp;&nbsp;
			<input type="button" value="添加教育背景" onclick="showAddEH();"/>
		</td>
	</tr>
	
	
	<%
		
		List ehList=new ArrayList();
		
		if(appId>0){
			
			ApplicationLeterService alService=new ApplicationLeterServiceImpl();
			
			Applicationleter al=new Applicationleter();
			
			al.setId(appId);
			
			//通过编号获得求职信息对象
			al=alService.getOneApplicationLeter(al);
			
			ehList=new ArrayList(al.getEducationhistorySet()); //将set转换为list
			
		}else{
			
			ehList=(List)ru.getSessionObject(ApplicationLeterService.EDUCATIONHISTORYLISTINSESSINO, new ArrayList());
			
		}

		//显示工作经历列表
	
		if(ehList!=null && ehList.size()>0){
			
			Educationhistory eh=null;
			
			for(int i=0;i<ehList.size();i++){
				
				eh=(Educationhistory)ehList.get(i);
				
				int id=i;
				
				if(appId>0) id=eh.getId();   //如果有求职信息编号，获得工作经历对应的数据库编号
	%>

	<tr>
		<td width="180" height="28">&nbsp;</td>
		<td width="520" align="right">
			<label> 
			 	<input type="button" value="删除" onclick="deleteEH('<%=id %>');"/>&nbsp;&nbsp;
			</label>
			
			<label> 
				<input type="button" value="编辑" onclick=""/>&nbsp;&nbsp;
			</label>
		</td>
	</tr>

	<tr>
		<td height="28" align="right">时间：</td>
		<td> <%=eh.getBeginDate() %> 到  <%=eh.getEndDate() %></td>
	</tr>
	
	<tr>
		<td height="28" align="right">学校名称：</td>
		<td><%=eh.getSchoolName() %></td>
	</tr>
	<tr>
		<td height="28" align="right">专业课程：</td>
		<td><%=eh.getProfessional() %></td>
	</tr>
	<tr>
		<td height="28" align="right">学 历：</td>
		<td><%= CodeMap.edu.get(eh.getSchoolRecord()).toString()  %></td>
	</tr>
	<tr>
		<td height="28" align="right">证书：</td>
		<td><%=eh.getCertificate() %></td>
	</tr>
	<tr>
		<td height="28" align="right">专业描述：</td>
		<td><%=eh.getProfessionalSummary() %></td>
	</tr>
	
	<tr>
		<td colspan="2" align="left" class="td_dashed"><label></label></td>
	</tr>
	
	<%
			}
		}
	%>
	
	
</table>

<!-- end 教育背景 -->


